package com.bite.ioc.component;

import com.bite.ioc.model.UserInfo;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserInfoComponent {

    @Bean
    public UserInfo userInfo1(){
        return new UserInfo("lisi", 19);
    }
    @Bean
    public UserInfo userInfo(){
        return new UserInfo("zhangsan", 18);
    }

    @Bean
    public String name(){
        return "test";
    }

    @Primary
    @Bean
    public String name2(){
        return "test2";
    }

//    @Primary
//    @Bean
//    public UserInfo userInfo2(@Qualifier("name") String name3){
//        return new UserInfo(name3, 19);
//    }
}
